/**
 * Created by maxiaoqiang on 2018/6/22.
 */

import React, {Component} from "react";

import {HashRouter as Router, Route, Switch, Redirect} from 'react-router-dom';
import {connect} from 'react-redux';

import Login from "page/user/login";
import Register from "page/user/Register";
import Forget from "page/user/Forget";


import Layouts from "layouts";

import "./app.less"

class App extends Component {

    render() {
        return (
            <Router>
                <Switch>
                    <Route exact path="/" render={() => <Redirect to="login" push />}/>
                    <Route path="/exam" component={Layouts}/>
                    <Route path="/login" component={Login}/>
                    <Route path="/register" component={Register}/>
                    <Route path="/forget" component={Forget}/>
                </Switch>
            </Router>
        );
    }
}
const mapStateToProps = (state) => ({
    screen: state.screenReducer.screen
});
export default connect(mapStateToProps)(App);